package cn.cqie.attendance.teacher.controller;

import cn.cqie.attendance.common.util.Page;
import cn.cqie.attendance.common.util.PageBean;
import cn.cqie.attendance.teacher.pojo.TeacherCourseReq;
import cn.cqie.attendance.teacher.pojo.TeacherCourseRes;
import cn.cqie.attendance.teacher.pojo.TeacherStudent;
import cn.cqie.attendance.teacher.service.TeacherCourseService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;


/**
 * @author wqh
 * @date 2021/6/14 17:37
 * 代码demo
 */
@RestController
@Api(tags = "教师端-教师课程安排模块")
@RequestMapping("/teacher/course")
public class TeacherCourseController {

    @Autowired
    TeacherCourseService teacherCourseService;

    @GetMapping("/queryCourseArrangeByTeacherId")
    @ApiOperation("教师查看自己的课程安排")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "beginDate", value = "2021-07-01"),
            @ApiImplicitParam(name = "endDate", value = "2021-07-02"),
            @ApiImplicitParam(name = "courseId", value = "1"),
            @ApiImplicitParam(name = "trainTeacher", value = "1"),
            @ApiImplicitParam(name = "responseTeacher", value = "1"),
            @ApiImplicitParam(name = "pageNum", value = "1"),
            @ApiImplicitParam(name = "pageSize", value = "10")
    })
    public PageBean<TeacherCourseRes> queryCourseArrangeByTeacherId(TeacherCourseReq param){
        return teacherCourseService.queryCourseArrangeByTeacherId(param);
    }
    @GetMapping("/queryStudentInfoByCourseId")
    @ApiOperation("教师查看课程下的学生")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "groupId", value = "int:1"),
            @ApiImplicitParam(name = "stuMajor", value = "2021-07-02"),
            @ApiImplicitParam(name = "courseId", value = "1",required = true),
            @ApiImplicitParam(name = "stuClass", value = "1"),
            @ApiImplicitParam(name = "stuGrade", value = "1"),
            @ApiImplicitParam(name = "stuName", value = "夏兵"),
            @ApiImplicitParam(name = "stuNumber", value = "189000421"),
            @ApiImplicitParam(name = "pageNum", value = "1"),
            @ApiImplicitParam(name = "pageSize", value = "10")
    })
    public PageBean<TeacherStudent> queryStudentInfoByCourseId(@RequestParam(value = "courseId") Integer courseId, Integer groupId, Integer stuMajor, Integer stuGrade, Integer stuClass, String stuName, String stuNumber, Integer pageNum, Integer pageSize){
        return teacherCourseService.queryStudentInfoByCourseId(courseId,groupId,stuMajor,stuGrade,stuClass,stuName,stuNumber,pageNum,pageSize);
    }
}
